import 'package:flutter/cupertino.dart';
import 'package:flutter/widgets.dart';

import '../../public.dart';
import 'mixins/widget_base.dart';

/// 版权信息
class ReaderCopyRight extends StatefulWidget {
  ReaderCopyRight({Key key}) : super(key: key);

  @override
  ReaderCopyRightState createState() => new ReaderCopyRightState();
}

class ReaderCopyRightState extends State<ReaderCopyRight> with ReaderWidgetBase {
  @override
  void initState() {
    super.initState();
  }

  @override
  void dispose() {
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    if (readModel.currentChapter == null) {
      return SizedBox.shrink();
    }
    if (readModel.currentChapter.comicModel.isNoCopyright) {
      return Positioned(
          left: 0,
          right: 0,
          bottom: 0,
          top: 0,
          child: Container(
              decoration: BoxDecoration(color: Color(0xff1B1B26)),
              child: Column(
                mainAxisAlignment: MainAxisAlignment.center,
                crossAxisAlignment: CrossAxisAlignment.center,
                children: [
                  SVG.svg('no_comic', width: 150, height: 110),
                  Text(
                    '应版权方要求，该漫画下架啦',
                    style: TextStyle(color: Color(0x99ffffff), fontSize: 12),
                  ),
                  SizedBox(height: 6),
                  Text(
                    '左滑看看其他精彩漫画吧',
                    style: TextStyle(color: Color(0x99ffffff), fontSize: 12),
                  )
                ],
              )));
    }
    return Container();
  }
}
